home *** CD-ROM | disk | FTP | other *** search
- # QuotePaths
- #
- # QuotePaths <base> <sub> <dir1> <dir2> ... <dirn>
- # --> 'Base:Dir1:Sub:' 'Root:Dir2:Sub:' ... 'Root:Dirn:Sub:'
- # (with aliases resolved).
- #
- # Stupid script to construct, quote, resolve, and quote pathnames.
- # Plus, it quotes them for good measure. Loathe MPW, dream of Unix...
-
- set PROCESS Quote
-
- loop
- # Break on non-option.
- if "{1}" == "--"
- break
- else if "{1}" !~ /-?+/
- break
- else if "{1}" == "-b"
- set BASE "{2}"
- shift
- else if "{1}" == "-s"
- set SUBDIR ":{2}"
- shift
- else if "{1}" == "-r"
- set PROCESS ResolveAlias
- else if "{1}" == "-p"
- Set PRESERVE yup
- else if "{1}" == "-qd"
- shift
- superquote -d `"{0}" {"parameters"}`
- exit
- else if "{1}" == "-q"
- shift
- superquote -x `"{0}" {"parameters"}`
- exit
- else
- echo "QuotePaths: warning: unknown option '{1}'." > Dev:console
- end
- shift
- end
-
- If "{PRESERVE}"
- for dir in {parameters}
- Echo -n "∂∂∂"{BASE}{dir}{SUBDIR}∂∂∂" "
- end
- Else
- for dir in {parameters}
- {PROCESS} "{BASE}{dir}{SUBDIR}"
- end
- End
-
-
- exit
- # The end.
-